﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Visio.ForwardEngineer.DataModel;

namespace Visio.ForwardEngineer.UserInterface
{
    public partial class ValidateModelForm : Form
    {
        public ValidateModelForm()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Returns the model file name chosen by the user
        /// </summary>
        public string ModelFileName
        {
            get
            {
                return comboBoxModelNames.SelectedItem.ToString();
            }
        }

        /// <summary>
        /// Let the user choose the model to validate
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ValidateModelForm_Load(object sender, EventArgs e)
        {
            comboBoxModelNames.Items.Clear();
            string[] modelNames = ModelTransformer.GetModels();
            comboBoxModelNames.Items.AddRange(modelNames);
            if (modelNames.Length == 1)
            {
                comboBoxModelNames.SelectedItem = modelNames[0];
                comboBoxModelNames.Enabled = false;
            }
        }
    }
}
